/* SPDX-License-Identifier: GPL-2.0-or-later */
/* -*- mode: c; c-basic-offset: 8; -*-
 * vim: noexpandtab sw=8 ts=8 sts=0:
 *
 * super.h
 *
 * Function prototypes
 *
 * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
 */

#ifndef OCFS2_SUPER_H
#define OCFS2_SUPER_H

#define OCFS2_TIMEOUT_PRI	(0x1000001)  /* DLM_TIMEOUT_PRI + 1 */

enum {
	OCFS2_WS_STATE		= 1,
	OCFS2_XCOPY_STATE	= 2,
	OCFS2_CAW_STATE		= 3,
};

__printf(4, 5)
void __ocfs2_error(struct super_block *sb, const char *function, int line,
		   const char *fmt, ...);

#define ocfs2_error(sb, fmt, args...) __ocfs2_error(sb, __PRETTY_FUNCTION__, __LINE__, fmt, ##args)

__printf(3, 4)
void __ocfs2_abort(struct super_block *sb, const char *function,
		   const char *fmt, ...);

#define ocfs2_abort(sb, fmt, args...) __ocfs2_abort(sb, __PRETTY_FUNCTION__, fmt, ##args)

void ocfs2_handle_recovery_invalid(struct ocfs2_super *osb);
void ocfs2_resize_may_interrupted(struct ocfs2_super *osb);
void ocfs2_try_to_resize(struct super_block *sb, u64 block, u64 device_max_blocks);
void ocfs2_resize_device(struct super_block *sb);

/*
 * Void signal blockers, because in-kernel sigprocmask() only fails
 * when SIG_* is wrong.
 */
void ocfs2_block_signals(sigset_t *oldset);
void ocfs2_unblock_signals(sigset_t *oldset);

int ocfs2_get_vaai_switch_state(struct ocfs2_super *osb,
		unsigned int vaai_flag);
int ocfs2_get_vaai_switch_state_nolock(struct ocfs2_super *osb,
		unsigned int vaai_flag);

int ocfs2_multidev_update_storage_attr(struct super_block *sb);
#endif /* OCFS2_SUPER_H */
